<?php
class Shell {
	public static function initTenUpper($uid=''){
		$connection = Yii::app()->db;
		$sql = "select * from nc_user where user_id != ". Yii::app()->user->id ." order by issue_num DESC limit 10";
		$user = $connection->createCommand($sql)->queryAll();
		if(!empty($user)){
			foreach($user as $key=>$value){
				/*
				$upper = new Upper();
				$upper->upper_user_id = $value['user_id'];
				$upper->upper_user_name = $value['user_name'];
				$upper->user_id = Yii::app()->user->id;
				$upper->user_name = Yii::app()->user->name;
				$upper->upper_time = time();
				$upper->save();	
				*/
				Upper::addUpper($value['user_id']);
				$upperId[]=$value['user_id'];
			}
		}
		return $upperId;
	}
}